package com.jiangjiang.eshop.comment.convert;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jiangjiang.eshop.comment.domain.CommentInfoEntity;
import com.jiangjiang.eshop.comment.dto.CommentDetailDTO;
import com.jiangjiang.eshop.comment.dto.CommentInfoDTO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mybatis.spring.annotation.MapperScan;

import java.util.List;


/**
 * @ClassName CommentInfoConvert
 * @Description TODO
 * @Author jhw
 * @Date 2021/5/17 23:17
 * @Version 1.0
 **/
@Mapper(componentModel = "spring")
public interface CommentInfoConvert {
    /**
     * 将DTO对象转化成Entity
     * @param commentInfoDTO
     * @return
     */
    CommentInfoEntity convertInfoDTO2Entity(CommentInfoDTO commentInfoDTO);

    Page<CommentInfoDTO> convertPageEntity2DTO(Page<CommentInfoEntity> selectPage);

    CommentDetailDTO convertInfo2DetailDTO(CommentInfoEntity entity, List<String> pictureUrls);
}
